package day5;

/**
 * @author oldliu
 * @since 1.0
 */
public class Caculator {
    public int div(int a,int b){
        int c=a/b;
        return c;
    }
    public int chu(int a,int b)throws Exception{
        if(b==0)
            throw  new Exception("除数不能是0");
        int c=a/b;
        return c;
    }
    public int chu2(int a,int b)throws Exception{
        try {
            int c = a / b;
            return c;
        }catch (Exception e){
            System.out.println("出现了错误：");
            e.printStackTrace();
            throw e;
            //throw new Exception(e);
        }
    }
}
